package com.tcl.api.code;

/**
 * @Author liuf
 * @Date 2021/1/6 20:18
 * @Description
 */
public enum ErrorEnum {

    SUCCESS(200, "成功"),
    SERVER_DB_ERROR(10000, "操作失败，请稍后再试"),
    SERVER_ERROR(10001, "操作失败，请稍后再试"),
    UNKNOWN_ERROR(10002, "操作失败，请稍后再试"),
    PARAMETER_ERROR(10003, "参数错误"),
    TOKEN_NULL(10020, "token 为空"),
    TOKEN_INVALID(10021, "token 错误"),
    TOKEN_EXPIRED(10022, "token 已过期"),
    REFRESHETOKEN_NULL(10030, "refresh token 为空"),
    REFRESHETOKEN_INVALID(10031, "refresh token 错误"),
    REFRESHETOKEN_EXPIRED(10032, "refresh token 已过期"),
    ACCESSTOKEN_REQUSET_LIMIT(10040, "accesstoken 刷新次数达到限制"),
    AUTHENTICATION_ERROR(10041, "鉴权错误"),
    PRODUCTKEY_NULL(10050, "productkey 为空"),
    PRODUCTKEY_INVALID(10051, "productkey 错误"),
    PRODUCTSECRET_NULL(10052, "productsecret 为空"),
    PRODUCTSECRET_INVALID(10053, "productsecret 错误"),
    INVALID_MAC_ADDRESS(10054, "不可用的mac地址"),
    QR_CODE_INVALID(10070, "无效二维码"),
    QR_CODE_EXPIRED(10071, "二维码已过期"),
    VERIFICATION_CODE_INVALID(10080, "验证码错误"),
    VERIFICATION_CODE_EXPIRED(10081, "验证码过期"),
    VERIFICATION_CODE_SEND_TOO_MUNCH(10082, "验证码请求过于频繁，请稍后再试"),
    VERIFICATION_CODE_INVALID_TOO_MUNCH(10083, "验证码错误次数过多，请稍后再试"),
    MESSAGE_SEND_FAIL(10090, "短信发送失败"),
    MESSAGE_SEND_TOO_MUNCH(10091, "短信发送次数达到限制"),
    DEVICE_NOT_EXIST(10100, "设备不存在"),
    DEVICE_OFFLINE(10101, "设备不在线"),
    DEVICE_PERMISSION_LIMIT(10102, "您已经失去了设备的控制权限"),
    DEVICE_NOT_BOUND(10103, "设备未被绑定"),
    DEVICE_ALREADY_BOUND(10104, "设备已被绑定"),
    DEVICE_ALREADY_SHARED(10105, "用户已经绑定该设备"),
    DEVICE_NO_GATEWAY(10106, "网关子设备暂不支持该功能"),
    DEVICE_SHARED_TOO_MUCH(10107, "设备分享用户数达到限制"),
    DEVICE_BIND_BY_OTHER(10108, "设备已被他人绑定"),
    USER_NOT_EXIST(10150, "用户不存在"),
    USER_NOT_EXIST_GROUP(10151, "用户不存在（集团）"),
    USER_NOT_EXIST_HUAN(10152, "用户不存在（欢网"),
    USER_NOT_DEVICE_MASTER(10153, "您不是设备主人，无法进行此操作"),
    ACCOUNT_NOT_VERIFIED(10200, "用户原始身份未验证或验证超时"),
    ACCOUNT_NULL(10201, "账号/手机号为空"),
    ACCOUNT_NO_EXIST(10202, "账号/手机号不存在"),
    ACCOUNT_DISABLE(10203, "账号/手机号被禁用/锁定"),
    ACCOUNT_LOCK(10204, "该账号已被冻结，请联系TCL客服人员进行处理"),
    ACCOUNT_REGISTERED(10205, "账号/手机号已经注册"),
    ACCOUNT_INVALID(10206, "账号/手机号格式错误"),
    PHONE_ALREADY_BIND(10207, "用户输入的手机号已经被绑定过"),
    PASSWORD_NULL(10250, "密码为空"),
    PASSWORD_INVALID(10251, "密码错误"),
    PASSWORD_FORMAT_ERROR(10252, "密码格式不正确"),
    PASSWORD_INVALID_TOO_MUNCH(10253, "密码连续错误5次，请1小时后登录"),
    PASSWORD_SAME(10254, "新旧密码不能相同"),
    SECRET_QUESTION_NOT_SET(10280, "密保问题未设置"),
    SECRET_QUESTION_INVALID(10281, "密保问题验证失败"),
    SAFE_CODE_NOT_SET(10290, "安全码未设置"),
    SAFE_CODE_INVALID(10291, "安全码输入错误"),
    BINDCODE_INVALID(10300, "操作失败，请稍后再试"),
    VERSION_REJECTED(10301, "操作失败，请稍后再试"),
    MASTER_CANNT_CANCEL_SHARING(10302, "主人不能取消分享自己，请使用取消绑定"),
    AUTHENTICATION_FAILED(10303, "操作失败，请稍后再试"),
    JSON_FORMAT_ILLEGAL(10304, "操作失败，请稍后再试"),
    THIRD_AUTHORIZATION_CANCELLED(10500, "操作失败，请稍后再试"),
    THIRD_STATE_INVALID(10501, "操作失败，请稍后再试"),
    THIRD_AUTHORIZATION_ILLEGAL(10502, "授权码非法"),
    THIRD_AUTHORIZED_USERS_NO_EXIST(10503, "未发现授权用户"),
    THIRD_CONTROL_COMMAND_ILLEGAL(10504, "暂不支持该功能"),
    THIRD_TOKEN_REQUEST_ERROR(10505, "获取第三方授权错误"),
    THIRD_REQUEST_ERROR(10506, "获取第三方授权错误"),
    THIRD_RESPONE_ERROR(10507, "获取第三方授权错误"),
    THIRD_GET_DEVICES_ERROR(10508, "获取设备列表失败"),
    THIRD_CANCELGRANT_ERROR(10509, "取消授权失败"),
    THIRD_SUBSCRIBEDEVICE_ERROR(10510, "第三方设备订阅错误"),
    THIRD_UNSUBSCRIBEDEVICE_ERROR(10511, "第三方取消设备订阅错误"),
    THIRD_GET_DEVICESNAPSHOT_ERROR(10512, "获取信息失败"),
    SENCE_NO_CREATOR(11000, "您不是场景创建者，无法进行该操作"),
    SENCE_EXCLUSION_ACTIONS(11001, "场景中存在互斥的动作，执行失败"),
    SCENE_NAME_EXIST(11002, "该场景名称已存在，请重新设置"),
    ROOM_NAME_NULL(11003, "房间名为空");
    private int code;
    private String message;

    private ErrorEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public void setMessage(String msg) {
        this.message = msg;
    }

    public String getMessage() {
        return this.message;
    }

}
